<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">
<!--
 * Created on 2013-3-3
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
-->
 <head>
  <title> </title>
  <script type="text/javascript" src="/public/theme/js/jquery-1.9.1.min.js"></script>
  <script type="text/javascript">
  	$(function(){
  	        $('#id1').click(function(){
  	                $(this).next.html('<div class="id2">B</div>');
  	                return false;
  	        
  	        });
  	        $('.id2').click(function(){
  	                alert('bbbb');
  	        });
  	});
  </script>
 </head>
<body>
<div style="display:none;">
<!--clone div start-->
    <div >
        <input type="file" name="img[]" /><a href="#" name="rmlink">X</a>
    </div>
</div>
<!--clone div end-->
<form action="dowater.php" method="post" enctype="multipart/form-data">
<label>请选择上传的图片</label>
<a href="#" id="addimg" >增加图片</a>
<div id="mdiv">
    <div >
    <input type="file" name="img[]" /><a href="#" name="rmlink">X</a>
    </div>
</div>
<input type="submit" name="submit" value="上传图片"  />
</form>
<script type="text/javascript" >
var temp; 
$(document).ready(function(){        
 temp = $(".iptdiv:first");
 $("a[name=rmlink]").click(function(){
  $(this).parent().remove();
    })
 $("#addimg").click(function(){
  temp.clone(true).appendTo($("#mdiv"));
 })
})
</script>
</body>
 
</html>
